package com.kevin.chat.dao.impl;

import com.kevin.chat.dao.UserDao;
import com.kevin.chat.data.UserData;
import com.kevin.chat.entity.UserEntity;
import org.springframework.stereotype.Repository;

@Repository
public class UserDaoImpl implements UserDao {
    public UserEntity register(UserEntity user) {
        UserData.put(user);
        return user;
    }

    @Override
    public UserEntity login(UserEntity user) {
        return UserData.get(user.getLoginName());
    }

    @Override
    public UserEntity getUserByLoginName(String loginName) {
        return UserData.get(loginName);
    }
}
